import React, { Component } from 'react'
import Tabbar from '../Common/Tabbar'
import Header from '../Common/Header'
import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
class My extends Component {
    render() {
        return (
            <div className="my">
                <Header title="饿了么" back={<span onClick={() => { this.props.history.push({ pathname: '/home' }) }}>&lt;</span>}></Header>
                <div className="content">
                    <div className="user">
                        <div className="img">
                            <div></div>
                        </div>
                        <div className="text">
                            <h3>yang011208</h3>
                            <h6>131****7776</h6>
                        </div>
                    </div>
                    <div className="yhq">
                        <img className="img" src="102.jpg" alt="" />
                    </div>
                    <div className="list">
                        <div className="item"><span>我的红包</span><span>></span></div>
                        <div className="item"><span>我的津贴</span><span>></span></div>
                        <div className="item">
                            <span>我的地址</span><Link to="/shdz">{
                                this.props.dzaddress.dz
                                    ?
                                    this.props.dzaddress.dz
                                    :
                                    '快去添加地址吧！'
                            }></Link>
                        </div>
                        <div className="item">
                            <span>我的收藏</span>
                            <Link to="/mysc">
                                {
                                    this.props.sclist.length > 0
                                        ?
                                        `已收藏${this.props.sclist.length}个店铺`
                                        :
                                        '还没有收藏的店铺！'
                                }>
                                </Link>
                        </div>
                        <div className="item"><span>我的客服</span><span>></span></div>
                        <div className="item"><span>规则中心</span><span>></span></div>
                    </div>
                </div>
                <Tabbar></Tabbar>
            </div>
        )
    }
}
export default connect(
    (state) => {
        return {
            sclist: state.sclist,
            adddz: state.adddz,
            dzaddress: state.dzaddress
        }
    },
    (dispatch) => {
        return {

        }
    }
)(My)